ARG FRAPPE_BRANCH=develop
FROM registry.cn-shanghai.aliyuncs.com/xdicloud/erpnext-worker:${FRAPPE_BRANCH}

USER root
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list

RUN sed -i 's|security.debian.org/debian-security|mirrors.ustc.edu.cn/debian-security|g' /etc/apt/sources.list

RUN apt-get update \
    && apt-get install --no-install-recommends -y \
    xfonts-intl-chinese \
    ttf-wqy-microhei \
    ttf-wqy-zenhei \
    && rm -rf /var/lib/apt/lists/*

USER frappe

# Using douban pipy mirror
RUN /usr/local/bin/python -m pip install -i https://pypi.douban.com/simple/ -U pip 
RUN /usr/local/bin/python -m pip config set global.index-url https://pypi.douban.com/simple/


# RUN install_app posawesome https://github.com/yrestom/POS-Awesome master && \
RUN install_app frappe_s3_attachment https://gitee.com/eanfs32/frappe-attachments-s3.git master && \
# RUN install_app metabase_integration https://github.com/pipech/frappe-metabase master && \
# RUN install_app bookings https://github.com/franknyarkoh/bookings master && \
  install_app wiki https://gitee.com/eanfs32/wiki master && \
  install_app bench_manager https://gitee.com/eanfs32/bench_manager develop && \
  install_app erpnext_chinese https://gitee.com/eanfs32/erpnext_chinese develop